/**
 * @Author: Lenovo
 * @Date: 2024/11/9 23:12
 * @description:
 */
public class Demo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
           while (!Thread.currentThread().isInterrupted()){
               System.out.println("Hello Thread!");
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException e) {
                   /*throw new RuntimeException(e);*/
                    /*break;*/
               }
           }
            System.out.println("t 线程 结束");
        });
        t.start();
        Thread.sleep(3000);
        System.out.println("main 线程 尝试 阻塞 t 线程");
        t.interrupt();
    }
}
